package jok.demo;

public class ExceptionDemo {

	public static void main(String[] args) {

		try {
			int[] arr = new int[10];
			System.out.println(arr[10]);

			int c = 0;
			c = 10 / 0;
		} catch (ArithmeticException e) {
			e.printStackTrace();
		} catch (IndexOutOfBoundsException e) {
			e.printStackTrace();
		}

		try {
			int[] arr = new int[10];
			System.out.println(arr[10]);

			int c = 0;
			c = 10 / 0;
		} catch (Exception e) {
			if (e instanceof ArithmeticException) {
				e.printStackTrace();
			} else {
				e.printStackTrace();
			}
		}
	}
}
